generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 19
feat: Add Automated PyPI Publishing Workflow #83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
+244
−1
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
arangatang
reviewed
Nov 11, 2025
* feat(sigv4_helper): inject AWS_REGION in _meta * Override the sigv4 signature when adding _meta. * feat(sigv4_helper): add region and service argument to _inject_metadata_hook to allow for proper resigning of sigv4 to work * feat(server.py): add forwarding region as optional argument * feat: replace forwarding region with metadata forwarding * refactor: move the hooks from sigv4_helper.py into a new folder and add tests * refactor(siv4_helper.py): move signing logic from client creation to an event hook * test(test_hooks.py): add assertions * refactor(sigv4_helper.py): remove hooks.py module and move hooks to sigv4_helper.py This refactor was needed in order to avoid a circular depdency, which resulted in a mid-module import. --------- Co-authored-by: Kyon Caldera <kyonc@amazon.com> Co-authored-by: Leonardo Araneda Freccero <araneda@amazon.com>
1966ae5 to
459de24
Compare
wzxxing
reviewed
Nov 12, 2025
1b9b4e9 to
876c584
Compare
arangatang
reviewed
Nov 12, 2025
876c584 to
18d4e0a
Compare
arangatang
previously approved these changes
Nov 12, 2025
wzxxing
reviewed
Nov 12, 2025
19953a4 to
c65b56f
Compare
wzxxing
approved these changes
Nov 12, 2025
arangatang
approved these changes
Nov 13, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add Automated PyPI Publishing Workflow
Overview
This PR implements a GitHub Actions workflow that automatically publishes the
mcp-proxy-for-awspackage to PyPI when a new release is created. The workflow ensures code quality through automated testing, validates version formatting, builds distribution packages, and securely publishes to PyPI using API token authentication.Changes
New Files
.github/workflows/pypi-publish-on-release.yml- Main publishing workflowWorkflow Architecture
The workflow consists of three sequential jobs that create a fail-fast pipeline:
Key Features
1. Automated Testing Integration
python.ymlworkflow to run unit tests before publishing2. Version Validation
pyproject.tomlusing Python'stomllib3. Secure Package Building
uvpackage manager (consistent with existing workflows)4. PyPI Publishing with API Token
pypa/gh-action-pypi-publish@release/v1official actionPYPI_API_TOKENsecret5. Security Best Practices
Setup Requirements
Before this workflow can be used, the following setup is required:
1. PyPI API Token
PYPI_API_TOKEN2. GitHub Environment (Optional but Recommended)
pypiTesting Strategy
Post-Release Verification
pip install mcp-proxy-for-awsUsage
Creating a Release
Update version in
pyproject.toml:Commit and push changes:
git add pyproject.toml git commit -m "Bump version to 1.0.0" git push origin mainCreate and publish a GitHub release:
v1.0.0(matching the version)The workflow automatically:
Error Handling
The workflow handles various failure scenarios:
Design Decisions
Why API Token Instead of Trusted Publishing?
Why Reuse python.yml?
Why Sequential Jobs?
Why uv for Building?
Requirements Satisfied
This implementation satisfies all requirements from the specification:
Related Documentation
Checklist
Is this a breaking change? (Y/N)
Please add details about how this change was tested.
Acknowledgment
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.